<?php
class Planesmejoramiento_Form_Crearplan extends Form_Base{
	
	public function __construct($options = null) {
		parent::__construct($options);
	}
	
	public function init() {
		$this->setName('plan');
		$this->setMethod("post");
		$this->setAttrib('enctype', 'multipart/form-data');
		$domConfig = Zend_Registry::get('domConfig'); //esto se crea en el bootstrap
		
		$array_elements[] = new Zend_Form_Element_Hidden("codplanmejoramiento");
		$array_elements[] = new Zend_Form_Element_Hidden("tipoplan");
		$array_elements[] = new Zend_Form_Element_Hidden("codproceso");
		
		$element = new Zend_Form_Element_Textarea('nombreplan');
		$element->setLabel('Nombre del plan :');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
		$element->setAttrib("rows",3);
		$element->addValidator('StringLength', false, array($domConfig->TEXTO_TAMANOMIN));
        $array_elements[] = $element;

		$element = new Zend_Form_Element_Textarea('objetivo');
		$element->setLabel('Objetivo del plan :');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
		$element->setAttrib("rows",3);
		$element->addValidator('StringLength', false, array($domConfig->TEXTO_TAMANOMIN));
		$array_elements[] = $element;
		
        $element = new App_Form_Element_Datepicker('fechainicioplan',false);
		$element->setLabel('Fecha inicio :');
		$element->setRequired(true);
		$element->setAttrib("readonly","readonly");
		$array_elements[] = $element;

		$element = new App_Form_Element_Datepicker('fechafinplan',false);
		$element->setLabel('Fecha fin :');
		$element->setRequired(true);
		$element->setAttrib("readonly","readonly");
		$array_elements[] = $element;
		
		$element = new Zend_Form_Element_Submit ( 'btnSubmit' );
		$element->setValue('Guardar');
		$element->setLabel("Guardar");
		$element->setAttrib("class", "iceCmdBtn");
		$array_elements[] = $element;
		
		$this->addElements ($array_elements);
		
		$this->loadTableDecorators();
	}
	
}